<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	//设置请求编码格式
	request.setCharacterEncoding("UTF-8");

	//获取用户输入的内容
	String msg = request.getParameter("msg");

	//存放聊天记录的集合
	List<String> msgList = null;
	//判断appliation中是否有聊天记录
	if (application.getAttribute("msgList") != null) {
		msgList = (List<String>) application.getAttribute("msgList");
	} else {
		msgList = new ArrayList<String>();
	}
	// application←msgList←msginfo
	msgList.add(msg);
	application.setAttribute("msgList", msgList);
	response.sendRedirect("msg.jsp");
%>
